Skip to content

What a tab shows, through the link (features) and ⋮ «Optionen» - #41

Merged
cedricvogel-leo merged 2 commits into
mainfrom
feature/link-settings
Nov 6, 2026
Merged

cedricvogel-leo merged 2 commits into
mainfrom
feature/link-settings

Conversation

@cedricvogel-leo

@cedricvogel-leo cedricvogel-leo commented Nov 6, 2026 •

Copy link
Copy Markdown
Collaborator

P34 C: what an IDE tab shows, set by the link and switchable in ⋮ «Optionen».

Installs glpython-editor v0.1.30 (#56: a switch of its own for ▶).

What it does

  1. The embed's vocabulary: run (▶), tests, visualize, repl (the console's >>> line), export («→-Kette kopieren» in the visualizer), coverage, listtree and tree (the visualizer's mode «Baum»). Other names (ide, reset, unknown ones) are ignored.
  2. In the link: an optional "features": [...] in the payload, next to openFile and files. It works in ?p= and in the old ?project=.
    • Without a project: a plain ?features=run,repl (or #features=) on the address sets the tab too. A link's own features win.
  3. Starting state, not a lock:
    • Switches: ⋮ → Optionen opens a dialog with a switch for each part, in German and English.
    • Keeping: the tab keeps its settings across a reload.
    • «Teilen» writes the tab's current settings. A tab that never had settings writes none, so its links stay as they were.
  4. The REPL line off: the console stays, and input() still asks in its line when a program runs.
  5. Without settings: exactly as today.

The defaults (no settings)

Part Today Without settings Embed (block without features=)
run, tests, visualize, repl on on on
export on (the IDE never switched it off) on on
coverage on (the IDE passed coverage: true) on off
listtree, tree off off off

So the IDE differs from the embed only in coverage. To hide the export from learners, a link leaves out export.

The field

{ "v": 2, "name": "…", "mainFile": "auswerter.py", "openFile": "aufgabe.md",
  "features": ["run", "repl", "visualize", "tests", "coverage", "listtree", "tree"],
  "files": { … } }
  • Shape: an array of strings, in any order.
  • Unknown names are dropped.
  • An empty array means every part is off.
  • Leaving the field out means the defaults.

Checks (test:browser, all 26 pass)

New cases:

  • Without repl (run, tests, visualize, ide):
    • the top bar has ▶, Tests and Visualisieren, and there's no REPL line;
    • a program with input() asks in the console, and the answer runs through;
    • ⋮ Optionen shows the link's settings (ide dropped); switching «Eingabezeile» on brings the REPL line back;
    • after a reload it's still there, and «Teilen» writes ["run", "tests", "visualize", "repl"].
  • listtree and tree: a list value in the REPL gets «Baum», the visualizer offers «Kasten / Ersetzung / Baum», and the variables panel draws the tree.
  • ▶ without Tests, Tests without ▶: only that button shows, and Tests runs.
  • Without features: old ?project= and new ?p= both show the three buttons and the REPL line. Optionen shows the defaults, and «Teilen» writes no features.
  • ?features=run,visualize without a project: those two buttons, no REPL line.

The embed side (the block's features= into the link) is glpython-liascript#35, checked there.

Screenshots

  • ⋮ → Optionen;
  • a project without the REPL line, with the program's own input() prompt as the console's only input line;
  • desktop and iPad portrait.

Going live

  1. This PR (on v0.1.30): merging deploys the IDE.
  2. The macro PR: merge it with the Etappe 4 release bump. Before the IDE is deployed, the old IDE ignores features (unknown fields don't break a link), so the order is only about when the parts show up.

Manual tests

Desktop (Chrome, Safari, Firefox):

  1. A link with features without repl: no >>> line.
  2. ▶ a program with input(): it asks in the console.
  3. ⋮ → Optionen: «Eingabezeile» on, the line is back.
  4. Reload: still on.
  5. «Teilen», then open the link in a new tab: the same parts.
  6. A link with listtree,tree: «Baum» in the visualizer, and «Baum» on a list value in the REPL.
  7. An old hand-in link: everything as before.

iPad (Safari, external keyboard):

  1. ⋮ → Optionen with Tab and Enter.
  2. In the dialog: Tab moves through the switches, Space toggles, Esc closes and the focus returns to ⋮.
  3. Portrait: the dialog fits, and the console's program line takes the input.

Follow-ups (not done)

  • Nothing on screen says that a part was switched off by the link. A learner who misses the REPL line finds it under ⋮ → Optionen.
  • resetOutput (the workspace's own Reset) stays off in the IDE: ⋮ «Python neu starten» does that job. It isn't in the vocabulary.
  • The ZIP doesn't keep the settings yet. A downloaded and reopened project starts with the defaults.

🤖 Generated with Claude Code

cedricvogel-leo and others added 2 commits November 6, 2026 19:05
A share link can set which parts the IDE shows, in the embed's
features= vocabulary (run, tests, visualize, repl, export, coverage,
listtree, tree; others ignored): "features" in the payload (both
encodings), or ?features= without a project. It is the tab's starting
state: ⋮ «Optionen» switches each part, the tab keeps them across a
reload, «Teilen» writes the current settings (none for a tab that never
had any). Without settings, as before: everything but listtree and tree.
Needs glpython-editor's run switch (#56).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cedricvogel-leo
cedricvogel-leo merged commit 0dabf48 into main Nov 6, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant